package edu.scu.declaresys.dao.impl;

import edu.scu.declaresys.dao.DAOFactory;
import edu.scu.declaresys.dao.intr.IMsgDAO;
import edu.scu.declaresys.exception.ExecuteException;
import edu.scu.declaresys.vo.Msg;

/**
 * 
 * @author: zt
 * @since : 2013-7-3
 */
public class MsgDAOImpl extends GeneralDAOImpl<Msg> implements IMsgDAO
{
	
	public MsgDAOImpl()
	{
		super(Msg.class);
	}

	@Override
	protected void fillReference(Msg vo, int depth) throws ExecuteException
	{
		vo.setMsgClass(DAOFactory.createMsgClassDAO().findById(vo.getMsgClassId(), depth-1));
		vo.setFromUser(DAOFactory.createUserDAO().findById(vo.getFromUserId(), depth-1));
		vo.setToCityUser(DAOFactory.createUserDAO().findById(vo.getToCityUserId(), depth-1));
		vo.setToProvinceuser(DAOFactory.createUserDAO().findById(vo.getToProvinceUserId(), depth-1));
	}
	
}
